<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('公告统计')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            公告id：<input type="text" name="noticeId"/>
                        </li>
                        <li>
                            公告类型id：<input type="text" name="typeId"/>
                        </li>
                        <li>
                            公告主题：<input type="text" name="noticeName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
<!--            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="notice:count:add">-->
<!--                <i class="fa fa-plus"></i> 新增-->
<!--            </a>-->
<!--            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="notice:count:edit">-->
<!--                <i class="fa fa-edit"></i> 修改-->
<!--            </a>-->
<!--            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="notice:manager:remove">-->
<!--                <i class="fa fa-remove"></i> 删除-->
<!--            </a>-->
            <!--            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export">-->
            <!--                <i class="fa fa-download"></i> 导出-->
            <!--            </a>-->
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    // var editFlag = [[${@permission.hasPermi('notice:manager:edit')}]];
    // var removeFlag = [[${@permission.hasPermi('notice:manager:remove')}]];
    var lookFlag = [[${@permission.hasPermi('notice:look:look')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "notice/count";

    $(function() {
        var options = {
            url: prefix + "/list",
            // createUrl: prefix + "/add",
            // updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/remove",
            // exportUrl: prefix + "/export",
            // sortName: "postSort",
            modalName: "公告",
            columns: [{
                checkbox: true
            },
                {
                    field: 'typeId',
                    title: '公告类型id'
                },
                {
                    field: 'noticeId',
                    title: '公告id'
                },
                {
                    field: 'noticeName',
                    title: '公告主题',
                    // sortable: true
                },
                {
                    field: 'seeTime',
                    title: '最后浏览时间',
                    // sortable: true
                },
                {
                    field: 'seeCount',
                    title: '浏览次数',
                    // sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        console.log(row.noticeId);

                        var actions = [];
                        // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.noticeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + lookFlag + '" href="/notice/count/look?noticeId=' + row.noticeId + '"><i class="fa fa-remove"></i>查看</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>